package com.xbb.controller;

import com.xbb.entity.Ecarts;
import com.xbb.service.EcartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EcartsController {

    @Autowired
    EcartsService ecartsService;

    /**
     * 获取咨询师各自所分配的学生（客户）
     * @return
     */
    @RequestMapping("/getZxsResInfo")
    public Object getZxsResInfo() {
        //获取x轴数据--name
        List<String> name = ecartsService.getZxsName();
        //获取y轴数据--num
        List<Integer> num = ecartsService.getZxsNum();
        //获取y轴已缴费数据--num
        List<Integer> innum = ecartsService.getZxsNumIn();
        //实例化对象，生成图表
        Ecarts ecarts = new Ecarts();
        ecarts.setXData(name);
        ecarts.setYData(num);
        ecarts.setYData1(innum);
        return ecarts;
    }

    /**
     * 获取网络咨询师各自所录入的学生（客户）
     * @return
     */
    @RequestMapping("/getWlzxsResInfo")
    public Object getWlzxsResInfo() {
        //获取x轴数据--name
        List<String> name = ecartsService.getWlzxsName();
        //获取y轴数据--num
        List<Integer> num = ecartsService.getWlzxsNum();
        ////实例化对象，生成图表
        Ecarts ecarts = new Ecarts();
        ecarts.setXData(name);
        ecarts.setYData(num);
        return ecarts;
    }

}
